package com.example.showcase.common.handler;

import com.example.showcase.common.ShowcasePacket;
import com.example.showcase.common.AbstractBizHandler;
import com.example.showcase.common.packets.P2PRespBody;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.tio.core.ChannelContext;
import org.tio.utils.json.Json;

/**
 * @author tanyaowu
 * 2017年3月27日 下午9:51:28
 */
public class P2PRespHandler extends AbstractBizHandler<P2PRespBody> {
    private static Logger log = LoggerFactory.getLogger(P2PRespHandler.class);

    /**
     * @param args
     * @author tanyaowu
     */
    public static void main(String[] args) {

    }

    /**
     * @author tanyaowu
     */
    public P2PRespHandler() {
    }

    /**
     * @return
     * @author tanyaowu
     */
    @Override
    public Class<P2PRespBody> bodyClass() {
        return P2PRespBody.class;
    }

    /**
     * @param packet
     * @param bsBody
     * @param channelContext
     * @return
     * @throws Exception
     * @author tanyaowu
     */
    @Override
    public Object handler(ShowcasePacket packet, P2PRespBody bsBody, ChannelContext channelContext) throws Exception {
        System.out.println("收到P2P响应消息:" + Json.toJson(bsBody));
        return null;
    }
}
